﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;

namespace Simple.Repository.Extensions
{
    public interface IDbConfig
    {
        string GetConnectionString();
    }

    public class DbConfig : IDbConfig
    {
        public readonly string _connectionString;

        // 构造函数接收外部传入的连接字符串
        public DbConfig(string connectionString)
        {
            _connectionString = connectionString ?? throw new ArgumentNullException(nameof(connectionString));
        }

        public string GetConnectionString()
        {
            return _connectionString;
        }
    }
}
